﻿using App.Components;
using FreeSql;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace App.DAL
{ 
    public class SysUser : EntityBase<SysUser>
    {
        [UI("账号"), Column(OldName = "Name")]     public string Account { get; set; }
        [UI("昵称")]                               public string NickName { get; set; }
        [UI("真名")]                               public string RealName { get; set; }
        [UI("手机号码")]                           public string Mobile { get; set; }
        [UI("是否有效")]                           public bool Enabled { get; set; } = true;
        [UI("最后登录日期")]                       public DateTime? LastLoginDt { get; set; }




        public static ISelect<SysUser> Search()
        {
            ISelect<SysUser> q = Set.Select;
            return q;
        }


        public override object Export(object obj = null)
        {
            var data = new
            {
                ID,
                Account,
                NickName,
                RealName,
                Mobile,
                Enabled,
                CreateDt = this.CreateDt.ToString("yyyy-MM-dd HH:mm:ss"),
                InUsed
            };
            return data;
        }
    }
}
